import Vue from 'vue'
import Vuex from 'vuex'
//引入模块
//系统管理模块
import variable from './Role/variable'
import roles from './Role/roles'
import admin from './Role/admin'
//引入绩效评分模块
import score from './Performance/score'
//员工管理模块
import AllStaff from './Staff/AllStaff'
//引入简历模块
import resume from './Resume/resume'
//菜单跳转
import MyMennu from "@/store/myMennu/myMennu";
import Information from "@/store/Department/Information"

Vue.use(Vuex)

export default new Vuex.Store({
    modules: {

        //系统管理模块
        variable,
        roles,
        admin,
        //绩效评分模块
        score,
        //员工管理模块
        AllStaff,
        //简历模块
        resume,
        //菜单跳转
        MyMennu,
        Information
    },
    state: {
        loginData:[],
        setBackList:[],
        setInSta:[],
        setoutJob:[],
        setjoinJob:[],
        setPerson:[],
        SynthDataAll:[],
        setdatas:[],
        sexData:[],
        setCompositeData:[],
        count: 0,
        pages: [
            {
                class: "el-icon-notebook-1",
                pageName: '部门网格',
                url:'/Department/Structure',

            },
            {
                class: "el-icon-date",
                pageName: '部门信息',
                url:'/Department/Information'

            },
            {
                class: "el-icon-user",
                pageName: '员工信息',
                url: '/Staff/AllStaffList'
            },
            {
                class: "el-icon-printer",
                pageName: '信息录入',
                url:'/Staff/InputStaffInfo'
            },
            {
                class: "el-icon-edit",
                pageName: '目标计划',
                url:'/target/editor'

            },
            {
                class: "el-icon-edit-outline",
                pageName: '月度目标',
                url:'/target/main'

            },
            {
                class: "el-icon-setting",
                pageName: '系统设置',
                url: '/role/settings'
            },
            {
                class: "el-icon-connection",
                pageName: '数据管理',
                url: '/CompositeData',
            },
            {
                class: "el-icon-s-custom",
                pageName: '管理人员',
                url:'/Staff/OnDutyStaffList'
            },
            {
                class: "el-icon-data-line",
                pageName: '数据统计',
                url: '',

            },
            {
                class: "el-icon-upload2",
                pageName: '数据导出',
                url:'/Staff/ImportStaffInfo'
            },
            {
                class: "el-icon-download",
                pageName: '数据导入',
                url:'/Staff/ExportStaffInfo'
            },
            {
                class: "el-icon-s-operation",
                pageName: '活动菜单',

            },

        ]
    },
    getters: {},
    mutations: {
        //部门员工
        setAycData(state,obj){
            state.SynthDataAll=obj
        },
        //人才数据
        setdatas(state,obj){
            state.setdatas=obj
        },

        //综合数据

        setCompositeData(state,obj){
            state.setCompositeData=obj

        },
         //性别
        setSexData(state,obj){
            state.sexData=obj

        },
        changeNumber(state) {
            state.count = 1
            // console.log(state.count)
        },
        changEve(state) {
            state.count = 0
        },
        //员工本统计
        setPerson(state,obj){
            state.setPerson=obj
        },
        //员工月份统计
        setjoinJob(state,obj){
            state.setjoinJob=obj
        },
        setoutJob(state,obj){
            state.setoutJob=obj
        },
        //员工在职状态
        setInSta(state,data){
            state.setInSta=data
        },
        //黑白名单
        setBackList(state,data){
            state.setBackList=data
        },
        //登录菜单数据
        loginData(state,data){
           state.loginData=data
            console.log(data)

        }
    },
    actions: {

        //人才
        setdatas(cxt,data){
            cxt.commit('setdatas',data)
        },
        //中和数据
        setCompositeData(cxt,data){
            cxt.commit('setCompositeData',data)
        },
         //性别
        setSexData(cxt,data){
            cxt.commit('setSexData',data)
        },
        //部门
        setAycData(cxt,data){
            cxt.commit('setAycData',data)
        },
        //员工基本统计
        setPerson(cxt,data){
            cxt.commit('setPerson',data)
        },
        //员工月份统计
        setjoinJob(cxt,data){
            cxt.commit('setjoinJob',data)

        },
         setoutJob(cxt,data){
             cxt.commit('setoutJob',data)
         },
        //员工在职状态
        setInSta(cxt,data){
            cxt.commit('setInSta',data)

        },
        //员工名单
        setBackList(cxt,data){
            cxt.commit('setBackList',data)
        },
        //登录数据
        loginData(cxt,data){
            cxt.commit('loginData',data)

        }

    },
})
